﻿// ******************************************************
// SMS.Framework
// SMS.Framework.Scientific.Astronomy
// Earth.cs
// Copyright (c) 2009, SMS Framework. All Rights Reserved.
// ******************************************************

using SMS.Framework.Core;

namespace SMS.Framework.Scientific.Astronomy
{

    /// <summary>
    /// Class to work with the astronomy information relationship with the Earth.
    /// <br></br>
    /// The cycle of the Earth around the Sun is of 365.24219 days.
    /// </summary>
    public class Earth
    {

        #region CONSTRUCTORS

            /// <summary>
            /// Contructor of the class.
            /// </summary>
            public Earth()
            { 
            }

        #endregion

        #region FUNCTIONS

            public EarthWeekDay DayOfWeek(System.DateTime data, EarthCalendar calendarType)
            {
                byte result = 0;
                if (calendarType == EarthCalendar.Julian)
                {
                    // Get the Julian date 
                    // Returns the result of the day of the week 
                    return (EarthWeekDay)(Conversion.DateToJulianDate(data) % 7);
                }
                else
                {
                    // Get the Gregorian date 
                    // Returns the result of the day of the week 
                    //return (EarthWeekDay)(Conversion.DateToGregorianDate(data) % 7);
                    return (EarthWeekDay)(Conversion.DateToJulianDate(data) % 7);
                }
            } 

        #endregion


    } // Earth

} // SMS.Framework.Scientific.Astronomy